home *** CD-ROM | disk | FTP | other *** search
- /*
- Created: Thursday, May 7, 1992 at 10:20 PM
- UGLibrary.h
- C Interface to UGLibrary.o
- The library to manipulate the Users & Groups Data File
-
- Copyright Apple Computer, Inc. 1991-1992
- All rights reserved
-
- 4/10/95 JML Added alignment pragmas and #includes for additional headers
-
- */
-
- #ifndef __TYPES__
- #include <Types.h>
- #endif
-
- #ifndef __OSUTILS__
- #include <OSUtils.h>
- #endif
-
- #if GENERATINGPOWERPC
- #pragma options align=mac68k
- #endif
-
- typedef unsigned char Str199[200];
- typedef unsigned char Str8[9];
-
- enum {
- /* ugUserFlags for UGNewUser, UGGetUserInfo, and UGSetUserInfo */
- IACEnabled = 1,
- LoginEnabled = 0x100,
- SuperUser = 0x200,
- NoChangePwd = 0x400,
- GetNewPwd = 0x1000
- };
-
- enum {
- /* ugSrvrFlags[0] for UGGetULInfo and UGSetULInfo */
- Apple2 = 1,
- NoGuests = 2,
- IACGuestEnabled = 16,
- IACGlobalEnabled = 32,
- /* ugSrvrFlags[1] for UGGetULInfo and UGSetULInfo */
- DontSavePwd = 1
- };
-
- enum {
- /* ugChngFlags codes for UGSetUserInfo */
- ChngUserPasswd = 1,
- ChngUserFlags = 2,
- ChngUAll = 3
- };
-
- enum {
- /* ugChngFlags codes for UGSetULInfo */
- ChngSrvrFlags = 1,
- ChngAdmnKey = 2,
- ChngMinPwdLen = 4,
- ChngMaxBadLogins = 8,
- ChngPwdExpDate = 16,
- ChngSrvrVersion = 32,
- ChngULAll = 63
- };
-
- enum {
- /* server version as returned by UGGetULInfo */
- Sys7SrvrVer = 3,
- AS3SrvrVer = 4
- };
-
- /* These are the Param Blocks for the interface calls: */
-
- #define UGPBHeader \
- QElemPtr qLink;\
- short qType;\
- short ugTrap;\
- Ptr ugCmdAddr;\
- ProcPtr ugCompletion;\
- OSErr ugResult;\
- StringPtr ugNamePtr;\
- short ugVRefNum;\
- short ugRefNum;\
- long ugDirID;\
- long ugAccessID;\
- unsigned long ugUserID;\
- unsigned long ugGroupID;
-
- /* Use UGFilePB for UGOpenFile, UGCloseFile and UGCreateFile */
- struct UGFilePB {
- UGPBHeader
- StringPtr ugAdminKey;
- };
-
- #ifndef __cplusplus
- typedef struct UGFilePB UGFilePB;
- #endif
-
-
- /* Use UGUserPB for UGNewUser, UGDeleteUser, UGRenameUser, UGGetUserInfo, */
- /* UGSetUserInfo, and UGAuthenticateUser */
- struct UGUserPB {
- UGPBHeader
- short ugPosOffset;
- StringPtr ugMisc;
- short ugChngFlags;
- StringPtr ugPassword;
- long ugUserFlags;
- short ugNumBadLogins;
- long ugPwdDate;
- short ugNumGroups;
- long ugGroups[42];
- };
-
- #ifndef __cplusplus
- typedef struct UGUserPB UGUserPB;
- #endif
-
-
- /* Use UGGroupPB for UGNewGroup, UGDeleteGroup, UGRenameGroup, UGGetGroupInfo, */
- /* UGAssignUserToGroup, and UGDeleteUserFromGroup */
- struct UGGroupPB {
- UGPBHeader
- short ugPosOffset;
- StringPtr ugMisc;
- Boolean ugPrimaryFlag;
- };
-
- #ifndef __cplusplus
- typedef struct UGGroupPB UGGroupPB;
- #endif
-
-
- /* Use UGServerPB for UGGetULInfo and UGSetULInfo */
- struct UGServerPB {
- UGPBHeader
- StringPtr ugAdminKey;
- short ugSrvrVersion;
- short ugChngFlags;
- long ugSrvrFlags[2];
- Byte ugMinPwdLen;
- Byte filler1;
- short ugMaxBadLogins;
- long ugPwdExpDate;
- };
-
- #ifndef __cplusplus
- typedef struct UGServerPB UGServerPB;
- #endif
-
-
- union UGParamBlockRec {
- UGFilePB ugFilePB;
- UGUserPB ugUserPB;
- UGGroupPB ugGroupPB;
- UGServerPB ugServerPB;
- };
-
- #ifndef __cplusplus
- typedef union UGParamBlockRec UGParamBlockRec;
- #endif
-
- typedef UGParamBlockRec *UserGroupPBPtr;
-
-
- /* Declaration of functions */
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- pascal OSErr UGOpenFile(UserGroupPBPtr thePB, Boolean async);
- pascal OSErr UGCloseFile(UserGroupPBPtr thePB, Boolean async);
- pascal OSErr UGCreateFile(UserGroupPBPtr thePB, Boolean async);
-
- pascal OSErr UGNewUser(UserGroupPBPtr thePB, Boolean async);
- pascal OSErr UGDeleteUser(UserGroupPBPtr thePB, Boolean async);
- pascal OSErr UGRenameUser(UserGroupPBPtr thePB, Boolean async);
- pascal OSErr UGGetUserInfo(UserGroupPBPtr thePB, Boolean async);
- pascal OSErr UGSetUserInfo(UserGroupPBPtr thePB, Boolean async);
- pascal OSErr UGAuthenticateUser(UserGroupPBPtr thePB, Boolean async);
-
- pascal OSErr UGNewGroup(UserGroupPBPtr thePB, Boolean async);
- pascal OSErr UGDeleteGroup(UserGroupPBPtr thePB, Boolean async);
- pascal OSErr UGRenameGroup(UserGroupPBPtr thePB, Boolean async);
- pascal OSErr UGGetGroupInfo(UserGroupPBPtr thePB, Boolean async);
-
- pascal OSErr UGAssignUserToGroup(UserGroupPBPtr thePB, Boolean async);
- pascal OSErr UGDeleteUserFromGroup(UserGroupPBPtr thePB, Boolean async);
-
- pascal OSErr UGGetULInfo(UserGroupPBPtr thePB, Boolean async);
- pascal OSErr UGSetULInfo(UserGroupPBPtr thePB, Boolean async);
-
-
- #ifdef __cplusplus
- }
- #endif
-
- #if GENERATINGPOWERPC
- #pragma options align=reset
- #endif
-